var api = require('./api.js')
var request = require('./request.js')

// 热门兑换
function getHotFn(){
	return request.requestApi({
	  url: api.hotApi
	})
}

function getRecommendFn() {
  return request.requestApi({
    url: api.recommendApi
  })
}


// 获取用户信息
function getUserInfoFn(params) {
  return request.requestApi({
    url: api.userInfoApi,
    data: params,
  })
}

// 登录
function LoginFn(params) {
  return request.requestApi({
    url: api.loginApi,
    data: params,
    header: {
      'content-type': 'application/x-www-form-urlencoded'
    },
    method: 'POST'
  })
}

// 获取验证码
function sendSMSFn(params) {
  return request.requestApi({
    url: api.smsApi,
    data: params,
    header: {
      'content-type': 'application/x-www-form-urlencoded'
    },
    method: 'POST'
  })
}

module.exports = {
  getHotFn,
  getRecommendFn,
  LoginFn,
  sendSMSFn,
  getUserInfoFn
}